package com.zxc.project.request;

import lombok.Data;
import com.zxc.project.base.BaseRequest;
import com.zxc.project.pojo.Variety;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
* @author zxc_user
* @date 2021/2/27 8:40
* @version 1.0
* @description 保存或者修改菜品
**/
@Data
public class SaveOfUpdateVarietyRequest extends BaseRequest<Variety> {

    //名字
    @NotBlank(message = "名字不能为空")
    private String name;

    @NotNull(message = "价格不能为空")
    private BigDecimal price;

    @NotNull(message = "菜品优惠不能为空")
    @Min(value = 0, message = "菜品优惠最小值为0")
    @Max(value = 100, message = "菜品优惠最大值为100")
    private Integer discount;

    @NotNull(message = "菜品总量不能为空")
    @Min(value = 0, message = "菜品总量最小值为0")
    @Max(value = Long.MAX_VALUE, message = "菜品总量超过最大值")
    private Long total;

    //菜品介绍
    private String introduce;

    //菜品描述
    private String varietyDesc;
}
